<template>
  <div>
    <div align="center" style="margin:25px">
      <el-avatar :size="64" :src="formData.userHead"></el-avatar>
      <div>{{ formData.userName }}</div>
    </div>
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" size="medium" label-width="100px">
        <el-col :span="12">
          <el-form-item label="登录名" prop="userLogin">
            <el-input v-model="formData.userLogin" readonly clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="手机号" prop="userPhone">
            <el-input v-model="formData.userPhone" readonly clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="角色" prop="userRoles">
            <el-input v-model="formData.userRoles" readonly clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="部门" prop="userDeptId">
            <el-input v-model="formData.userDeptId" readonly clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="创建人" prop="createUser">
            <el-input v-model="formData.createUser" readonly clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="创建时间" prop="createTime">
            <el-input v-model="formData.createTime" readonly clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="修改人" prop="modifyUser">
            <el-input v-model="formData.modifyUser" readonly clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="修改时间" prop="modifyTime">
            <el-input v-model="formData.modifyTime" readonly clearable :style="{width: '100%'}"></el-input>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
import { get } from "@/api/user";

export default {
  data() {
    return {
      formData: {
        userName: "",
        userLogin: "",
        userPhone: "",
        userRoles: "",
        userDeptId: "",
        createUser: "",
        createTime: "",
        modifyUser: "",
        modifyTime: ""
      }
    };
  },
  methods: {
    see(userId) {
      console.log(userId);
      get(userId).then(res => {
        this.formData = res.data;
      });
    }
  }
};
</script>
<style>
</style>
